<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="jstl-fn" prefix="fn" %>
<%@ taglib prefix="c" uri="jstl"%>
<jsp:include page="Templates/metas.jsp"/>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->
		
		<jsp:include page="Templates/headerEng.jsp"/>
		
		<div id="container_aside">
		<span id="node_chat_njsd" class="ico_chat"></span>
       <jsp:include page="Templates/submenu_miredpostEng.jsp"/>
       
        <section id="container_right">
        	<h1 class="mine_title"><img src="img/shadow_title.png" class="shadow_mineTit">MI REDPOST</h1>
				<h2 class="subtitle txt_blue underline">DELIVERY ADDRESS CHANGE FOR SHIPPING <span class="left_buttons"><img alt="btn_close" src="img/btn_close.png"> <span>Delete address</span></span></h2>
				<p class="txt_small txt_gray">
					In this section you can change the delivery address per shipment: <span class="link_blue">${Datos.descripcion}</span>
					<br>
					Data with an asterisk (<span class="txt_red">*</span>) are indispensable.
				</p>
				<ul class="cont_miredForms">
					<li>
								
						<html:form action="mis_envios_dir_eng.do">
							<table class="table_reg">
								<c:if test="${save eq '1' }">
									<tr>
										<td colspan="3">
											<p class="mensajeOk">
												<img alt="icoOk" src="img/icoOk.png" > Data updated correctly.
											</p>
										</td>
									</tr>
								</c:if>
								<tr>
				        			<th colspan="2" class="txt_red">
				        			 	&nbsp;<html:errors/>
				        			 	<input type="hidden" name="acc" id="acc" value="2" />
				        			 	<input type="hidden" name="num" value="${num}" />
				        			 </th>
				        		</tr>
								<tr>
									<td  width="40%" align="right"><span class="txt_red">*</span>Consignee:</td>
									<td  width="60%" colspan="2"><input type="text" class="txt_input" size="25" name="consignado" value="${consignado}"></td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>Street name:</td>
									<td colspan="2"><input type="text" class="txt_input" name="calle" size="25" value="${calle}"></td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>Number:</td>
									<td  colspan="2">
										<input type="text" class="txt_input" size="7" name="exterior" value="${exterior}"> <input type="text" name="interior" class="txt_input" size="7" value="${interior}">
										<br>
										<small><span class="txt_red">*</span>External &ensp; &emsp; &emsp; &emsp; Internal</small>
									</td>
								</tr>
								<tr>
									<td align="right">Additional references:</td>
									<td colspan="2"><textarea class="txt_input" name="referencias" cols="27" rows="3">${referencias}</textarea></td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>Zip code:</td>
									<td colspan="2"><input type="text" class="txt_input" size="12" value="${cp }" name="cp"> <a href="#" class="btn_cp" onclick="document.getElementById('acc').value='5';document.forms['dirpersonalForm'].submit();"><img alt="" src="img/btn_buscarSmallEng.png"></a></td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>More address data:</td>
									<td colspan="2">
										<select name="colonia" id="colonia" class="txt_input">
											<option value="">Choose an option</option>
											<c:forEach items="${colonias }" var="colonia">
												<c:if test="${colonia_sel eq  colonia}">
													<option selected>${colonia}</option>
												</c:if>
												<c:if test="${colonia_sel ne  colonia}">
													<option>${colonia}</option>
												</c:if>
											</c:forEach>
										</select>
									</td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>City or province:</td>
									<td colspan="2">
										<input type="text" class="txt_input" value="${ciudad}" size="26" disabled readonly />
										<input type="hidden" name="ciudad" value="${ciudad}" />
									</td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>State:</td>
									<td colspan="2">
										<input type="text" class="txt_input" name="estado" value="${estado}" size="26" disabled readonly />
										<input type="hidden" name="estado" value="${estado}" />
									</td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>E-mail:</td>
									<td colspan="2"><input type="text" class="txt_input" name="email" value="${email }" size="26"></td>
								</tr>
								<tr>
									<td align="right"><span class="txt_red">*</span>Confirm E-mail:</td>
									<td colspan="2"><input type="text" class="txt_input" name="email_confirm" value="${email_confirm}" size="26"></td>
								</tr>
								<!-- telefonos -->
								<tr>
									<td width="40%" align="right"><span class="txt_red">*</span>Home pone :</td>
									<td width="10%">
										<input type="text" class="txt_input" maxlength="3" onkeypress="return ValidNum(event);" name="lada_casa" value="${lada_casa }" size="4">
										<small>Area Code</small>
									</td>
									<td  width="50%">
										<input type="text" class="txt_input" maxlength="8" onkeypress="return ValidNum(event);" name="tel_casa" value="${tel_casa }" size="14">
										<br>
										<small>8 digits</small>
									</td>
								</tr>
								<tr>
									<td align="right">Work pone:</td>
									<td>
										<input type="text" class="txt_input" maxlength="3" onkeypress="return ValidNum(event);" name="lada_oficina" value="${lada_oficina }" size="4">
										<small>Area Code</small>
									</td>
									<td>
										<input type="text" class="txt_input" maxlength="8" onkeypress="return ValidNum(event);" name="tel_oficina" value="${tel_oficina }" size="14">
										<br>
										<small>8 digits</small>
									</td>
								</tr>
								<tr>
									<td align="right">Cell phone:</td>
									<td>
										<input type="text" class="txt_input" maxlength="3" onkeypress="return ValidNum(event);" name="lada_movil" value="${lada_movil }" size="4">
										<small>Area Code</small>
									</td>
									<td>
										<input type="text" class="txt_input" maxlength="8" onkeypress="return ValidNum(event);" name="tel_movil" value="${tel_movil }" size="14">
										<br>
										<small>8 digits</small>
									</td>
								</tr>
								<tr>
									<td colspan="3" class="txt_gray"><input type="checkbox" name="agregar" value="1"> I want to keep this address in my addresses book</td>
								</tr>
								<tr>
									<td colspan="3">
										<a href="#avisoPriv" class="fancybox link_blue" value="1">Privacy notice</a> &ensp; <input type="checkbox" name="privacidad" value="1"> <span class="txt_gray">I have read the privacy notice.</span>
									</td>
								</tr>
								<tr>
									<td colspan="3" align="center"><input type="image" src="img/btn_actualizaDatosEng.png"></td>
								</tr>
								
							</table>
						</html:form>
					</li>
					<!-- direcciones -->
					<li>
						<h2 class="subtitle txt_blue txt_center">MY ADDRESSES BOOK</h2>
						<hr>
						<div class="div_scroll">
						<script type="text/javascript">
							function libDirSen(id,acc){
								var acep = false;
								if(acc==3){
									acep = confirm("Want to change the address?");
								}else if(acc==4){
									acep = confirm("Do you want to delete the address?");
								}
								if( acep == false ){
									return false;
								}

								document.getElementById("accL").value = acc;
								document.getElementById("dirL").value = id;								
								document.forms["libdirpersonalForm"].submit();
								return true;
							}
						</script>
						<html:form action="mis_envios_dir_lib.do">
							<input type="hidden" name="acc" id="accL" value="0" />
							<input type="hidden" name="num" id="numL" value="${num}" />
							<input type="hidden" name="dir" id="dirL" value="0" />
						</html:form>
						
						<c:forEach items="${direcciones}" var="dir">
							<div class="cont_direcciones">
								<a href="#" class="btn_closeDir"><img alt="btn_close" src="img/btn_close.png" onclick="return libDirSen(${dir.cve_direccion},4);"></a>
								<p>
									<b>${dir.consignado}</b>
									<br>
									${dir.calle} ${dir.num_ext}, interior ${dir.num_int} Colonia ${dir.colonia}
									<br>
									${dir.ciudad}, ${dir.estado} C.P. ${dir.cp}
									<br><br>
									<input type="radio" name="selDirLib" value="${dir.cve_direccion}" onclick="return libDirSen(${dir.cve_direccion},3);"> <i>Use this delivery address.</i>
								</p>
							</div>
						</c:forEach>
						</div>
					</li>
				</ul>
				<div class="buttons_right">
					<a href="mis_envios.do"><img border="0" alt="btn_regresar" src="img/btn_regresarEng.png"></a>
				</div>
        </section>
        <span class="clear"></span>
        </div>
        
<jsp:include page="Templates/footerEng.jsp"/>